package controllers

import (
	"golang.org/x/net/context"
	"rpc_models"
	"time"
)

type SystemGetTimeArgs struct {
	Base BaseRequest
}

func (t *BaseRPC) SystemGetTime(ctx context.Context, args *SystemGetTimeArgs, reply *rpc_models.SystemGetTimeReply) error {
	reply.IsSuccess = false
	errcode, errmsg := args.Base.Verify()
	if errcode > 0 || len(errmsg) > 0 {
		reply.Code = errcode
		reply.Msg = errmsg
		return nil
	}
	reply.IsSuccess = true
	reply.Code = 100000
	reply.CurrentTime = time.Now()
	return nil
}
